<%@ page import="java.util.Enumeration" %><%--
  Created by IntelliJ IDEA.
  User: oldliu
  Date: 2021/3/22
  Time: 9:26
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>Title</title>
</head>
<body>
<%
    //session.getAttributeNames()
    //System.out.println("---------获取请求头方式3-------------");
    // 拿到所有请求头
    Enumeration<String> e1 = request.getHeaderNames();
    while (e1.hasMoreElements()) {
        String headerName = (String) e1.nextElement();
        String headValue = request.getHeader(headerName);
        out.print(headerName + "=" + headValue+"<br>");
    }

%>
</body>
</html>
